The program will print:
The result is 5
Look at the new program again:
' Program with a variable ' LET VALUE = 2 + 3 PRINT "The result is", VALUE END
The first statement does several things:
VALUE
The LET
statement can be used with a variable to
save the result of arithmetic.
The value saved in the variable will stay there
until another statement changes it, or until the
program stops running.
What do you think the following program will write to the monitor?
' Saving a result in a variable ' LET SUM = 1 + 2 + 3 PRINT "The sum is", SUM END